package com.qs.home.entity;

import android.os.Parcel;
import android.os.Parcelable;

/**
 * 银行卡信息
 *
 * @Author ltzz
 * @Date 2019/8/27
 */
public class BackResultEntity implements Parcelable {
    private String bankCardNumber;//银行卡号
    private String bankCardType;//银行卡类别
    //银行名称
    private String bankName;
    private JsonRes jsonRes;

    public BackResultEntity() {
    }

    protected BackResultEntity(Parcel in) {
        bankCardNumber = in.readString();
        bankCardType = in.readString();
        bankName = in.readString();
        jsonRes = in.readParcelable(JsonRes.class.getClassLoader());
    }

    public static final Creator<BackResultEntity> CREATOR = new Creator<BackResultEntity>() {
        @Override
        public BackResultEntity createFromParcel(Parcel in) {
            return new BackResultEntity(in);
        }

        @Override
        public BackResultEntity[] newArray(int size) {
            return new BackResultEntity[size];
        }
    };

    public String getBankCardNumber() {
        return bankCardNumber;
    }

    public void setBankCardNumber(String bankCardNumber) {
        this.bankCardNumber = bankCardNumber;
    }

    public String getBankCardType() {
        return bankCardType;
    }

    public void setBankCardType(String bankCardType) {
        this.bankCardType = bankCardType;
    }

    public String getBankName() {
        return bankName;
    }

    public void setBankName(String bankName) {
        this.bankName = bankName;
    }

    public JsonRes getJsonRes() {
        return jsonRes;
    }

    public void setJsonRes(JsonRes jsonRes) {
        this.jsonRes = jsonRes;
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel parcel, int i) {
        parcel.writeString(bankCardNumber);
        parcel.writeString(bankCardType);
        parcel.writeString(bankName);
        parcel.writeParcelable(jsonRes, i);
    }

    public static class JsonRes implements Parcelable {
        private Long log_id;
        private BackResult result;

        public JsonRes() {
        }

        protected JsonRes(Parcel in) {
            if (in.readByte() == 0) {
                log_id = null;
            } else {
                log_id = in.readLong();
            }
            result = in.readParcelable(BackResult.class.getClassLoader());
        }

        public static final Creator<JsonRes> CREATOR = new Creator<JsonRes>() {
            @Override
            public JsonRes createFromParcel(Parcel in) {
                return new JsonRes(in);
            }

            @Override
            public JsonRes[] newArray(int size) {
                return new JsonRes[size];
            }
        };

        public Long getLog_id() {
            return log_id;
        }

        public void setLog_id(Long log_id) {
            this.log_id = log_id;
        }

        public BackResult getResult() {
            return result;
        }

        public void setResult(BackResult result) {
            this.result = result;
        }

        @Override
        public int describeContents() {
            return 0;
        }

        @Override
        public void writeToParcel(Parcel parcel, int i) {
            if (log_id == null) {
                parcel.writeByte((byte) 0);
            } else {
                parcel.writeByte((byte) 1);
                parcel.writeLong(log_id);
            }
            parcel.writeParcelable(result, i);
        }

        public static class BackResult implements Parcelable {
            private String bank_card_number;
            private String valid_date;//时间
            private String bank_card_type;
            private String bank_name;

            public BackResult() {
            }

            protected BackResult(Parcel in) {
                bank_card_number = in.readString();
                valid_date = in.readString();
                bank_card_type = in.readString();
                bank_name = in.readString();
            }

            public static final Creator<BackResult> CREATOR = new Creator<BackResult>() {
                @Override
                public BackResult createFromParcel(Parcel in) {
                    return new BackResult(in);
                }

                @Override
                public BackResult[] newArray(int size) {
                    return new BackResult[size];
                }
            };

            public String getBank_card_number() {
                return bank_card_number;
            }

            public void setBank_card_number(String bank_card_number) {
                this.bank_card_number = bank_card_number;
            }

            public String getValid_date() {
                return valid_date;
            }

            public void setValid_date(String valid_date) {
                this.valid_date = valid_date;
            }

            public String getBank_card_type() {
                return bank_card_type;
            }

            public void setBank_card_type(String bank_card_type) {
                this.bank_card_type = bank_card_type;
            }

            public String getBank_name() {
                return bank_name;
            }

            public void setBank_name(String bank_name) {
                this.bank_name = bank_name;
            }

            @Override
            public int describeContents() {
                return 0;
            }

            @Override
            public void writeToParcel(Parcel parcel, int i) {
                parcel.writeString(bank_card_number);
                parcel.writeString(valid_date);
                parcel.writeString(bank_card_type);
                parcel.writeString(bank_name);
            }
        }
    }
}
